<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
     var arr3 = [30,10,111,35,1899,50,45];
arr3.sort(function(a,b){
　　return a - b;
})
console.log(arr3);//输出 [10, 30, 35, 45, 50, 111, 1899]
    </script>
</body>
</html>